<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = [10,1,35,61,89,36,55]
        for(var i = 0; i < arr.length;i++){
            // console.log(arr[i]);
            for(var j = 0;j<arr.length-i;j++){

                if(arr[j]>arr[j+1]){
                    temp = arr[j];
                    arr[j] = arr[j+1]; //[1,1,35,61,89,36,55]
                    arr[j+1] = temp; //[1,10,35,61,89,36,55]
                }
            }
        }
        // console.log(arr);
    </script>
</body>
</html>